.col-md-12
  - if @metadata.present?
    .card
      .card-header
        h3.card-title
          i.icon.fas.fa-history
          = t('teardowns.index.upload_history')
      .card-body.p-0
        table.table.table-hover
          tr
            th = t('teardowns.index.uploaded_at')
            th = t('teardowns.index.app_name')
            th = t('teardowns.index.version')
            th = t('teardowns.index.type')
            th = t('teardowns.index.uploader')

            - if user_signed_in?
              th = t('teardowns.index.actions')
          - @metadata.each_with_index do |md, index|
            tr
              td
                span data-toggle="tooltip" title="#{md.created_at}"
                  = time_ago_in_words(md.created_at)
              td
                = link_to md.name, teardown_path(md)
              td
                = md.mobileprovision? ? '-' : "#{md.release_version} (#{md.build_version})"
              td
                = device_name(md.platform)
              td
                = md.user&.username || t('teardowns.index.anonymous')

              - if user_signed_in?
                td
                  a.btn.btn-tool href="#{teardown_path(md)}" data-confirm="#{t('teardowns.messages.confirm.destroy')}" data-method="delete"
                    i.fas.fa-trash-alt

      - if @metadata.total_pages > 1
        .card-footer.clearfix
          .float-right
            = paginate @metadata
  - else
    .card.card-outline.card-warning
      .card-header.card-border
        h3.card-title = t('teardowns.index.not_found.title')
      .card-body = t('teardowns.index.not_found.body_html')

